#ifndef _PIANO_PROGRAM_NOTE_TRACK_RENDERER_H_
#define _PIANO_PROGRAM_NOTE_TRACK_RENDERER_H_

#include <ne.h>

namespace pp
{
    const float NoteOffset[13] = {0.0f, 12.0f, 24.0f, 36.0f, 48.0f, 72.0f, 84.0f, 96.0f, 108.0f, 120.0f, 132.0f, 144.0f, 168.0f};

    class NoteTrackRenderer
    {
        public:
            NoteTrackRenderer();

            void setColor(const ne::Color &color)
            {
                mColor = color;
            }

            ne::Color getColor() const
            {
                return mColor;
            }

            bool build(ne::MIDITrack *pTrack);

            bool update(const double startTicks, const double endTicks, const double deltaY);

            bool render();

            void destroy();

            ~NoteTrackRenderer();

        private:
            ne::Color mColor;
            ne::MIDINoteTrack mNoteTrack;
            ne::DynamicGeometry *mpDynamicGeometry;
    };

    typedef std::list<NoteTrackRenderer*> NoteTrackRendererList;
    typedef NoteTrackRendererList::iterator NoteTrackRendererListIterator;
    typedef NoteTrackRendererList::const_iterator NoteTrackRendererListConstIterator;
}

#endif
